#ifndef NMQJ_ALG_HPP
#define NMQJ_ALG_HPP

#include "simulation.hpp"
#include "effective_ensemble.hpp"
#include "transition_map.hpp"
#include "initial_state.hpp"
#include "random.hpp"
#include "hamilton.hpp"
#include "channels.hpp"


using namespace boost::numeric::ublas;

class nmqj_alg: public simulation<nmqj_alg>,
		public effective_ensemble, 
		public channels, public MyRandom,
		public hamilton,public initial_state, 
		public transition_map {
  
private:
  double T_;
  double dt_;
  int M_;
  int source_state;
  vector<int> target_states;
  vector<double> transition_probs;
public:
  nmqj_alg();
  nmqj_alg(double T,double dt, int M,
	   effective_ensemble eff,
	   channels chans,
	   MyRandom rng,hamilton H,initial_state psi0,
	   transition_map tm);
  
  void det_evol(double t,double dt);
  
  void jumps(double t,double dt);
  
  void make_jumps();
  
  double pos_pjump(double t, double dt,int chan_idx,std::map<int,int>::iterator it);
  
  double neg_pjump(double t,double dt, int chan_idx,std::map<int,int>::iterator it,
		   right_const_iterator ir);
  
};



#endif
